Add limit configuration for number of projects#9172
Add limit configuration for number of projects#9172DaanHoogland merged 6 commits intoapache:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9172 +/- ##
===========================================
Coverage 15.53% 15.53%
+ Complexity 11968 11967 -1
===========================================
Files 5492 5492
Lines 480947 480953 +6
Branches 62483 59152 -3331
===========================================
+ Hits 74726 74729 +3
- Misses 397960 397963 +3
Partials 8261 8261
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
DaanHoogland
left a comment
There was a problem hiding this comment.
clgtm needs testing. is there a issue related to this? I remember such a thing. If we find it let's link it.
| Assert.assertEquals(defaultAccountCpuMax, result); | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
this test has several calls into the code and asserts in between. Do you think it can be split in separate test cases?
| "200", | ||
| "The default maximum primary storage space (in GiB) that can be used for an account", | ||
| null), | ||
| DefaultMaxAccountProjects( |
There was a problem hiding this comment.
adding the config here is a bit of a deprecated way of doing these. Have a look at ConfigKey<> for the prefered way.
Define a ConfigKey<> in a manager implementation or a service interface and then add the configKey to the return of the getConfirKeys() in the manager. You can then use the value more dynamically and it doesn't have to be preloaded in the config method.
I understand you are just following the convention you see in the files you are changing but still,...
| DefaultMaxDomainMemory("Domain Defaults", ManagementServer.class, Long.class, "max.domain.memory", "81920", "The default maximum memory (in MB) that can be used for a domain", null), | ||
| DefaultMaxDomainPrimaryStorage("Domain Defaults", ManagementServer.class, Long.class, "max.domain.primary.storage", "400", "The default maximum primary storage space (in GiB) that can be used for a domain", null), | ||
| DefaultMaxDomainSecondaryStorage("Domain Defaults", ManagementServer.class, Long.class, "max.domain.secondary.storage", "800", "The default maximum secondary storage space (in GiB) that can be used for a domain", null), | ||
| DefaultMaxDomainProjects("Domain Defaults",ManagementServer.class,Long.class,"max.domain.projects","50","The default maximum number of projects that can be created for a domain",null), |
| Assert.assertEquals(defaultDomainCpuMax, result); | ||
| } | ||
|
|
||
| @Test |
There was a problem hiding this comment.
again, can this test case be split?
There was a problem hiding this comment.
alrighty, I was able to do the changes as you described. Please let me know if there is anything else I can do.
There was a problem hiding this comment.
ok, this one looks good, not sure if the build failures are related.
…o split unit test in ResourceManagerImplTest into multiple smaller tests
11aecf4 to
86746b0
Compare
|
@blueorangutan package |
|
@borisstoyanov a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el7 ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 9835 |
borisstoyanov
left a comment
There was a problem hiding this comment.
@my-code-AL hi, thanks for this PR, there seems to be a problem with the unit tests
10:19:49 [INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.251 s - in org.apache.cloudstack.affinity.AffinityGroupServiceImplTest
10:19:49 [INFO]
10:19:50 [INFO] Results:
10:19:50 [INFO]
10:19:50 [ERROR] Errors:
10:19:50 [ERROR] ResourceLimitManagerImplTest.unnecessary Mockito stubbings ? UnnecessaryStubbing
10:19:50 [INFO]
10:19:50 [ERROR] Tests run: 1885, Failures: 0, Errors: 1, Skipped: 6
10:19:50 [INFO]
10:19:50 [INFO] ------------------------------------------------------------------------
10:19:50 [INFO] Reactor Summary for Apache CloudStack 4.20.0.0-SNAPSHOT:
Can you please look into this?
yadvr
left a comment
There was a problem hiding this comment.
LGTM - this needs additional review/testing, and check if it needs any Marvin tests?
|
@my-code-AL can you look at the unit tests @borisstoyanov pointed at? |
|
@DaanHoogland Will do! I've been busy at work but will fix soon! |
|
@blueorangutan package |
|
@my-code-AL a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10330 |
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 10337 |
|
@blueorangutan LLtest alma9 kvm-alma9 keepEnv |
|
@DaanHoogland a [LL] Trillian-Jenkins test job (alma9 mgmt + kvm-alma9) has been kicked to run smoke tests |
|
[LL]Trillian test result (tid-6953)
|
|
setting the limit to 1 an error occurs on creating the second: after deleting the first prj the second gets created. a second user can create their own prj: good work @my-code-AL , totally out of scope but I was wondering if there is any reason this setting is not dynamic (i.e. can be changed without restart) work for another day maybe ;) |
|
Awesome work, congrats on your first merged pull request! |
|
Will do! Thank you for your help and patience! |



Description
The following PR creates a new feature of adding a limit to the number of projects of accounts within a singular domain. This helps administrators organize resources.
Types of changes
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
The following issue has been tested with several mocked test cases that specify domain max projects and account max projects with valid and invalid inputs. Finally, the UI has been verified using a local linux environment; see above image in screenshots.